<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2017/4/7
  Time: 17:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<style type="text/css">
    #local-users-trees {
        min-width: 220px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0px;
        float: left;
    }

    .col-md-12 {
        padding-left: 0px;
    }

    .col-md-7 {
        padding-left: 0px;
    }
</style>
<!-- 页面标题 -->
<div class="pageheader">
    <div class="media">
        <div class="media-body">
            <ul class="breadcrumb">
                <li><a href="javascript:;"><span class="glyphicon glyphicon_menu_users_page"></span>用户</a></li>
                <li class="active">用户管理</li>
            </ul>
        </div>
    </div>
</div>
<!-- End 页面标题 -->

<!-- 页面内容 -->
<div class="contentpanel" ng-controller="UserController" ng-cloak style="overflow:auto;">

    <!-- 工具栏 -->
    <div class="media-options toolwrapper">

        <div class="media-options toolwrapper col-md-12">
            <div class="pull-left" id="device_btns">
                <button type="button" class="btn btn-primary" ng-click="addUser('input')" style="width:120px;"
                        ng-disabled="currentNode.id == 'root' || getOrgid().length == 0">添加用户
                </button>
            </div>
            <div class="pull-right">
                <form class="form form-search" action="">
                    <input id="searchInput" type="search" class="form-control" placeholder="按姓名搜索" ng-model="qualifier"
                           ng-keyup="searchUser()">
                </form>
            </div>
        </div>
        <div class="toolwrapper col-md-12" id="device_operate_tools">
            <button type="button" class="btn btn-default btn-sm" ng-click="editUser()"
                    ng-disabled="(getIDs().length!=1 && selectedUserIds.length == 0) || selectedUserIds.length > 1">编辑用户
            </button>
            <button type="button" class="btn btn-default btn-sm" ng-click="openDeleteUserModal()"
                    ng-disabled="getIDs().length==0 && selectedUserIds.length == 0">删除用户
            </button>
        </div>
        <!-- pull-right -->
    </div>

    <!-- End 工具栏 -->
    <!-- 设备管控主页面 -->
    <div class="row">
        <!-- 用户信息 -->
        <div class="col-md-12 mapwrapper" id="map-div" style="padding-right:0px;">
            <table ng-table="tableParams" class="table table-striped table-bordered table-hover ng-table-responsive"
                   ng-pagination="test.html"><!-- ng-pagination="test.html" -->
                <tr ng-repeat="user in $data">
                    <td header="'ng-table/headers/checkbox.html'">
                        <div class="ckbox ckbox-primary pull-left" ng-show="user.id!='admin'">
                            <input type="checkbox" id="{{user.id}}" ng-model="user.selected"
                                   ng-change="changeSelected(user)">
                            <label for="{{user.id}}"></label>
                        </div>
                    </td>
                    <td data-title="'账号'" sortable="'username'"><a href="#/user/{{user.id}}" ng-show="m_03010102">{{user.username}}</a>
                        <span ng-show="!m_03010102">{{user.username}}</span></td>
                    <td data-title="'姓名'" sortable="'name'" filter="{ 'name': 'text' }" ng-show="tags[0].status">
                        {{user.name}}
                    </td>
                    <td data-title="'邮箱'" sortable="'email'" filter="{ 'email': 'text' }" ng-show="tags[1].status">
                        {{user.email}}
                    </td>
                    <td data-title="'操作'" ng-show="tags[6].status" ng-show="m_03010101">
                        <button ng-show="user.id!='admin'&&m_03010101" id="unset-admin-btn" type="button" value="${id}"
                                class="btn btn-danger btn-xs" ng-click="openDelUserModal(user)"
                                style="width:48px;height:24px;">
                            <i class="fa fa-trash-o"></i> 删除
                        </button>
                    </td>
                </tr>
            </table>
            <tm-pagination conf="paginationConf"></tm-pagination>
        </div>
    </div>
    <!-- eng 用户信息 -->
</div>
<!-- End 页面内容 -->

<script type="text/ng-template" id="ng-table/headers/checkbox.html">
    <div class="ckbox ckbox-primary pull-left">
        <input type="checkbox" ng-model="allSelected" ng-change="toggleAllSelected()" id="allSelected">
        <label for="allSelected"></label>
    </div>
</script>